#!/usr/bin/env python
# -*- coding: utf-8 -*-

import tornado.web
#所有处理器的基类
class BaseHandler(tornado.web.RequestHandler):
    def initialize(self):
        self.loadRes =self.application.loadRes
        self.getText =self.application.getText
        self.getLangText =self.application.getLangText
        self.getCountryText =self.application.getCountryText
        
    @property
    def db(self):
        return self.application.db

    def get_current_user(self):
        return "longxin"
    @property
    def homePath(self):
        return self.application.homePath
    
    @property #这儿应该根据设备、语言来定位皮肤文件路径
    def fp(self):
	flag = self.get_argument("pc","")
        if flag=='1':return 'mb/zh-cn/'
	elif flag=='2':return 'mb/en-us/'
	elif flag=='3':return 'pc/en-us/'
        else: return 'pc/zh-cn/'

